Skip to content

feat: comparison table user avatar name#68

Open
lazzyms wants to merge 4 commits intoO2sa:mainfrom
lazzyms:feat/comparison-table-user-avatar-name
Open

feat: comparison table user avatar name#68
lazzyms wants to merge 4 commits intoO2sa:mainfrom
lazzyms:feat/comparison-table-user-avatar-name

Conversation

@lazzyms
Copy link
Copy Markdown

@lazzyms lazzyms commented Apr 12, 2026

Fixes #63

This pull request introduces several improvements and refactors to enhance user profile display, strengthen type safety, and update project tooling. The main feature is the addition of user avatars and display names throughout the UI, supported by changes to the API, data fetching, and types. It also improves error handling and updates ESLint configuration for better code quality.

User Profile Enhancements

  • Added name and avatarUrl fields to UserResult, GitHubUserData, and related types, and updated the GitHub GraphQL query and data fetching logic in lib/github.ts to retrieve and return these fields. [1] [2] [3] [4]
  • Updated the API response in app/api/compare/route.ts to include name and avatarUrl for each user, and adjusted the UI in components/comparison-table.tsx to display user avatars and names. [1] [2]

Type Safety Improvements

  • Replaced any types with unknown in several components and API handlers to improve type safety, e.g., in components/compare-form.tsx, app/page.tsx, and app/api/compare/route.ts. [1] [2] [3]
  • Updated badge and icon types in components/top-list.tsx to use ReactNode instead of any for better type checking. [1] [2]

Tooling and Code Quality

  • Added a new eslint.config.mjs using Next.js recommended configs and updated the lint script in package.json to use ESLint directly. [1] [2]

UI and Content Tweaks

  • Fixed HTML entity for apostrophe in the tie message in components/result-dashboard.tsx.
  • Minor UI improvements, such as adjusting the card header padding and winner highlighting in components/comparison-table.tsx.

Code Cleanup

  • Removed unused items array in components/breakdown-bars.tsx and cleaned up type definitions in components/comparison-table.tsx. [1] [2]

Copilot AI review requested due to automatic review settings April 12, 2026 07:24
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 2026

@lazzyms is attempting to deploy a commit to the osama's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

Thank you for the pull request! ✅

A maintainer will review this soon. Please be patient while we take a look. 🙌

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds GitHub user display metadata (full name + avatar) to the compare flow so the UI can show richer user headers, while also tightening some TypeScript error handling and updating lint/tooling.

Changes:

  • Extend GitHub data fetching + API response to include name and avatarUrl.
  • Update comparison UI to render avatar + display name (with username fallback).
  • Replace some any usages with unknown and introduce a flat ESLint config + updated lint script.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
types/user-result.ts Adds name/avatarUrl to the UI-facing user result model.
types/github.ts Adds name/avatarUrl to the GitHub fetch result type.
lib/github.ts Updates GraphQL query + mapping to return name/avatarUrl.
app/api/compare/route.ts Includes name/avatarUrl in API output and improves error typing.
components/comparison-table.tsx Renders avatar + display name in the comparison table header.
next.config.js Allows next/image to load GitHub avatar images from avatars.githubusercontent.com.
app/page.tsx Improves catch typing from anyunknown.
components/compare-form.tsx Improves prop typing (anyunknown).
components/top-list.tsx Replaces badge/icon any types with ReactNode.
components/result-dashboard.tsx Fixes apostrophe HTML escaping in tie message.
components/breakdown-bars.tsx Removes unused array (cleanup).
eslint.config.mjs Introduces flat ESLint config using Next configs.
package.json Changes lint script to run ESLint directly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lazzyms lazzyms changed the title Feat/comparison table user avatar name feat: comparison table user avatar name Apr 12, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dev-impact Error Error Apr 12, 2026 7:46pm


type CompareFormProps = {
data?: any;
data?: unknown;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't review the changes because the build was failing with Type 'unknown' is not assignable to type 'ReactNode'. This occurred because {data && } returns the value of data if truthy. Since data is typed as unknown, TypeScript cannot guarantee it is a valid renderable React child.

Solution: Try to apply the boolean coercion (!!data) to the conditional rendering block, take your time to find the solution that's fit the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display user full name and avatar in comparison table

3 participants